<?php
/**
 * Created by PhpStorm.
 * User: MR_THONG
 * Date: 2/16/2015
 * Time: 9:12 AM
 */
    App::uses('AppController', 'Controller');
    class CustomerTourController extends AppController {
        public function settour(){
            $this->loadModel('TourKind');

            $this->loadHeaderData();

            $params = $this->data;
            $this->loadModel('CustomerTour');
            $this->CustomerTour->set('customername',$params['Post']['customername']);

            $this->CustomerTour->set('tourname',$params['Post']['tourname']);

            $this->CustomerTour->set('customeremail',$params['Post']['customeremail']);
            $this->CustomerTour->set('customerphone',$params['Post']['customerphone']);
            $this->CustomerTour->set('customercompany',$params['Post']['customercompany']);
            $this->CustomerTour->set('customeraddress',$params['Post']['customeraddress']);
            $this->CustomerTour->set('startday',$params['Post']['startday']);
            $this->CustomerTour->set('numofaldult',$params['Post']['numofaldult']);
            $this->CustomerTour->set('numofchild',$params['Post']['numofchild']);
            $this->CustomerTour->set('others',$params['Post']['others']);
            if ($this->CustomerTour->save()){
                  $message = "Ban da dang ki thanh cong, Chung toi se lien lac voi ban trong vong 24h toi";
            }else{$message = "Loi dang ki, xin vui long dang ki lai sau";}
            $this->set('message',$message);
        }
    }
?>